package com.ruoyi.web.controller.qiushi.wetchat;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.qiushi.service.wechat.IPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private IPayService payService;

    @RequestMapping("/test")
    public void test() {
        System.out.println();
        System.out.println("tezt:\t" + "test");
        System.out.println();
    }

    /**
     * 普通订单回调
     *
     * @param params
     * @param request
     * @return
     */
    @RequestMapping("/orderWechatCallback")
    public AjaxResult orderWechatCallback(@RequestBody Map<String, Object> params, HttpServletRequest request) {
        System.out.println();
        System.out.println("tezt:\t" + params);
        System.out.println();

        payService.orderWechatCallback(params, request);
        return AjaxResult.success();
    }
}
